<template>
	<view class='wrapper'>
	  <head-title :titleText="titleText" showLeftButton="true"></head-title>
	  <view class="head">{{headTxt}}</view>
	  <form @submit="formSubmit">
		<radio-group @change="radioChange" name="radio">
		  <view hover-class="radioBg" class="checkbox" v-for="(item,index) in items" :key="index">
			<text>{{item.value}}</text>
			<radio :value="item.value" :checked="item.checked" />
		  </view>
		</radio-group>
		<button class="submit" type="primary" formType="submit">提交</button>
	  </form>
	</view>
</template>

<script>
	import headTitle from "../../components/headTitle.vue";
	import common from "../../common/network.js";
	var session = '',userid='',tid='',ac_id='';
	export default {
		components:{headTitle},
		data(){
			return{
				headTxt:'请选择举报原因',
				items: [
				  { name: 'qizha', value: '欺诈'},
				  { name: 'seqing', value: '色情'},
				  { name: 'zhengzhi', value: '政治谣言'},
				  { name: 'changshi', value: '常识性谣言'},
				  { name: 'fenxiang', value: '诱导分享'},
				  { name: 'yingxiao', value: '恶意营销'},
				  { name: 'yinsi', value: '隐私信息收集' },
				  { name: 'qinquan', value: '其他侵权类（冒名、诽谤、抄袭）'},
				]
			}
		},
		onLoad:function(options){
			session = options.session;
			if(options.userid!=undefined){
				userid = options.userid;
			}else{
				userid = '';
			}
			if(options.tid!=undefined){
				tid = options.tid;
			}else{
				tid = '';
			}
			if(options.ac_id!=undefined){
				ac_id = options.ac_id;
			}else{
				ac_id = '';
			}
		},
		methods:{
			formSubmit:function(e){
				var that = this;
				var str = e.detail.value.radio;
				var $data = {
					'type':'zvip_add_report',
					'session':session,
					'to_uid':userid,
					'to_data':str,
					't_id':tid,
					'ac_id':ac_id
				};
				common.network.request($data,function(res){
					console.log(res);
					uni.showModal({
						content: '感谢您的举报，我们将会对该用户进行审查，如情况属实，将会对该用户进行惩罚',
						showCancel:false,
						confirmText: '返回',
						confirmColor: '#4C1BD6',
						success:function(res){
							uni.navigateBack({
								
							})
						}
					})
				})
			}
		}
	}
</script>

<style scoped>
.head{
  font-size: 26px;
  color: #999;
  padding: 15rpx;
  padding-left: 20rpx;
  border-bottom: 1px solid #F1F1F1;
  background: #F1F1F1;
}
.checkbox{
  font-size: 30px;
  position: relative;
  padding: 30px 20px;
  overflow: hidden;
  background: #fff;
}
radio-group .checkbox wx-radio{
  top: 25px;
}
.checkbox::after{
  content: '';
  height: 1px;
  width: 100%;
  background: #dbdbdb;
  position: absolute;
  left: 20px;
  bottom: 0;
}
.checkbox:last-of-type::after{
  height: 0;
}
.checkbox radio{
  float: right;
  width: 90%;
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  position: absolute;
  top: 15px;
  right: 10px;
}
.wrapper .submit{
  width: 80%;
  margin-top: 80px;
  background: linear-gradient(to right,#AE33F6,#6673FF);
}
</style>
